package com.zxc.redis;

import org.redisson.Redisson;
import org.redisson.api.RDeque;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

public class RedissonDemo {

	public static void main(String[] args) {
		Config config = new Config();
		config
			//.setCodec(new FstCodec())
			.useSingleServer() //单例模式
			.setAddress("192.168.1.122:6379")//连接地址
			.setDatabase(1) // 数据库索引位置
			.setPassword("shijie99test") // 密码
			.setClientName("channelbatch") // 客户端名称
			;
		RedissonClient redisson = Redisson.create(config);
		
		
		RDeque<BusinessLogInfo> deque = redisson.getDeque("PaymentSystemBusinessLog");
		
		BusinessLogInfo info = new BusinessLogInfo();
		
		info.setOrderNo("11111111111111");
		info.setOperationDetail("测试");
		info.setOperationIp("192.168.1.111");
		info.setOperationTime("20161111111111");
		info.setOperationUser("用户");
		info.setOperationMac("mac");
		
		deque.add(info);
		
		info.setOperationDetail("测试1");
		deque.add(info);
		
		info.setOperationDetail("测试2");
		deque.add(info);
		
		info.setOperationDetail("测试3");
		deque.add(info);
		
		info.setOperationDetail("测试4");
		deque.add(info);
		
		info.setOperationDetail("测试5");
		deque.add(info);
	}
}
